function initGrid(){
	jQuery("#picture-grid")
	    .jqGrid
	    ({
	        url: base_url + '/pictures/ajax-fetch-pictures/',
			datatype: "json",
			colNames:['ID', 'Title', 'Place', /*'Article',*/ 'Date'], 
			colModel:
			[ 
				{ name: 'id',         index:'id',         width:55 }, 
				{ name: 'title',      index:'title',      width:90 }, 
				{ name: 'place',      index:'place',      width:100 },
				//{ name: 'article',    index:'article',    width:100 }, 
				{ name: 'created_at', index:'created_at', width:200, sorttype: 'date', datefmt:'Y-m-d' } 
			], 
			rowNum:10, 
			rowList:[10,20,30], 
			imgpath: '/jqGrid/themes/basic/images', 
			pager: jQuery('#grid-pager'), 
			sortname: 'id', 
			viewrecords: true, 
			sortorder: "desc",
			jsonReader: { repeatitems : false, id: "0" },
			//multiselect: true,
			caption:"Pictures Grid" 
			//afterInsertRow: function(id, data){
			//    jQuery("#picture-grid").setRowData( id, { 'article' : data['article']['title'] } );
			//}
	    })
	    .navGrid('#grid-pager', {edit:false, add:false, del:false});
}
    
function reloadGrid(article_id)
{ 
	jQuery("#picture-grid").setGridParam({
        url: base_url + '/pictures/ajax-fetch-pictures/article_id/' + article_id,
        page:1
    })
    .trigger("reloadGrid"); 
}  
